API Documentation
Public Member Functions | List of all members
nkWinUi::Font Class Referenceabstract

Offers an interface to work with fonts. More...

Public Member Functions

 Font ()
 
virtual ~Font ()
 
const nkMemory::StringgetName () const
 
const nkMemory::StringgetFaceName () const
 
unsigned int getSize () const
 
bool getDefault () const
 
bool getReadyForUse () const
 
void setName (nkMemory::StringView value)
 
void setFaceName (nkMemory::StringView value)
 
void setSize (unsigned int value)
 
void setDefault (bool value)
 
virtual void load ()=0
 
virtual void unload ()=0
 
void reload ()
 

Detailed Description

Offers an interface to work with fonts.

Fonts are available to customize the way text is rendered inside the UI components.

Constructor & Destructor Documentation

◆ Font()

nkWinUi::Font::Font ( )

Constructor.

◆ ~Font()

virtual nkWinUi::Font::~Font ( )
virtual

Destructor.

Remarks
For font destruction, please refer to FontManager::erase() to ensure proper cleanup.

Member Function Documentation

◆ getName()

const nkMemory::String& nkWinUi::Font::getName ( ) const
Returns
The current name of the font, as referred to from the FontManager.

◆ getFaceName()

const nkMemory::String& nkWinUi::Font::getFaceName ( ) const
Returns
The current font's face name.

◆ getSize()

unsigned int nkWinUi::Font::getSize ( ) const
Returns
The current size of the font.

◆ getDefault()

bool nkWinUi::Font::getDefault ( ) const
Returns
Whether the font is the default one or not.

◆ getReadyForUse()

bool nkWinUi::Font::getReadyForUse ( ) const
Returns
Whether the font is ready for use (loaded, true), or not (false).

◆ setName()

void nkWinUi::Font::setName ( nkMemory::StringView  value)

Sets the name of the font, as referred for resource managing.

Parameters
valueThe name to use.
Remarks
Used internally.

◆ setFaceName()

void nkWinUi::Font::setFaceName ( nkMemory::StringView  value)

Sets the face name to use.

Parameters
valueThe face name to use.
Remarks
Changing this parameter will need the font to be reloaded to be applied.

◆ setSize()

void nkWinUi::Font::setSize ( unsigned int  value)

Sets the font size to use.

Parameters
valueThe font size to use.
Remarks
Changing this parameter will need the font to be reloaded to be applied.

◆ setDefault()

void nkWinUi::Font::setDefault ( bool  value)

Sets whether this font is the default one or not.

Parameters
valueIf the font is the default one (true) or not (false).
Remarks
This is used internally.

◆ load()

virtual void nkWinUi::Font::load ( )
pure virtual

Loads the font and prepares it for rendering, given all parameters set (font face, size...).

◆ unload()

virtual void nkWinUi::Font::unload ( )
pure virtual

Unloads the font and clears the internal resources tied to it.

◆ reload()

void nkWinUi::Font::reload ( )

Shorthand for unloading, and reloading the font.


The documentation for this class was generated from the following file: